package com.example.model.log.service.controller;

import com.alibaba.fastjson.JSONObject;
import com.example.annotations.Autowired;
import com.example.annotations.Param;
import com.example.annotations.PostMapping;
import com.example.annotations.RestController;
import com.example.db.model.IPage;
import com.example.model.log.LogModel;
import com.example.model.log.service.LogModelService;
import com.example.utils.Results;

/**
 * @Classname LogController
 * @Description TODO
 * @Date 2022/8/14 13:09
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@RestController("/log")
public class LogController {

    @Autowired
    LogModelService logModelService;

    @PostMapping(value = "/page",desc = "接口日志")
    public JSONObject pageLogModelController(@Param(value = "pageNum",desc = "页码",defalultValue = "1")Integer pageNum,
                                             @Param(value = "pageSize",desc = "条数",defalultValue = "10")Integer pageSize,
                                             @Param(value = "searchParams",required = false)JSONObject object){
        IPage<LogModel> logModelIPage=logModelService.logModelPage(pageNum,pageSize,object);
        return Results.successLayuiTable(logModelIPage);
    }
}
